package jiali.test.easyfactory;

public class CalculateFactory {

    public static Operation createOperation(String operation) {
        Operation opera = null;
        switch (operation) {
            case "+":
                opera = new Add();
                break;
            case "-":
                opera = new Sub();
                break;
            case "*":
                opera = new Mul();
                break;
            case "/":
                opera = new Div();
                break;
        }
        return opera;
    }
}
